package org.jfk.tbox.net;

import java.util.Date;

import org.jfk.core.utils.ByteUtils;
import org.jfk.tbox.net.app.TBOX_SMSCtlCommand;
import org.jfk.tbox.net.app.TBOX_SMSCtlCommand.TBOX_SMSCtlCommandReq;

public class Test {

	public static void main(String[] args) {
		//testMsg();
		testByteSort();
		//System.out.println("1".getBytes()[0]);
	}
	
	public static void testAID(){
		TBOX_SMSCtlCommand a0102 = new TBOX_SMSCtlCommand();
		TBOX_SMSCtlCommandReq req  = a0102.loadSMSCtlCommandReqData(0x21, "1","600");
		System.out.println(req);
	}
	
	public static void testTime(){
		// TODO Auto-generated method stub
		//long a = 4294967295l;
		byte[] aa = {
				(byte)0xEA,
				(byte)0x6A,
				(byte)0xCD,
				(byte)0x8D
				};
		long a = ByteUtils.byte4Tolong(aa);
		//int a = ByteUtils.byte4ToInt(aa);
		Date date = new Date(0-(8*60*60*1000)+a*1000);
		
		byte b = 0x31;
		System.out.println(ByteUtils.bytesToASCII(aa));		
	}

	public static void testMsg(){
		byte[] a = ByteUtils.hexStringToBytes("464C432E000069005700EA6ACD8D0000000000010401000101000012000000000000313131313131313131313131313131313131353431353032354C39393039393739313336303055303031303436303033363634313436393937340102030400FF313131313131313131313131313131313150");
		System.out.println(System.currentTimeMillis() + " = " + ByteUtils.byteToHexString(a));
		TboxMsg msg = TboxMsgParser.loadMsg(a);
		System.out.println(msg);	
	}
	
	public static void testByteSort(){
		byte[] a = ByteUtils.hexStringToBytes("464C432E1e");
		byte[] b = ByteUtils.bytesInverse(a);
		System.out.println(ByteUtils.byteToHexString(b));
	}
}
